/*
 * @(#) UIProductionLine.java 2013-5-21 下午4:41:24
 * Copyright 2013 Rockwell Automation, Inc. All rights reserved.
 * Rockwell Automation PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */package com.osi.mes.base.object;

import com.datasweep.compatibility.client.Categorical;

/**
 * 用于界面显示对象使用，必须为带有Description属性的对象才可以使用
 * @author Nemo, 2013-5-21 下午4:58:35
 */
public class UIData{
	
	private Categorical data;
	
	public UIData(Categorical categoricalObject){
		this.data = categoricalObject;
	}
	
	@Override
	public String toString() {
		return data.getDescription();
	}

	public Categorical getObject(){
		return this.data;
	}
	
	@Override
	public boolean equals(Object obj)
	{
		if(obj instanceof Categorical)
		{
			Categorical data = (Categorical) obj;
			return data.getKey() == this.data.getKey();
		}
		else if(obj instanceof UIData)
		{
			return super.equals(obj);
		}
		else
		{
			return super.equals(obj);
		}
	}
}
